#!/bin/bash
# description:　Rsync war file
# version:	1.0
# author:	zhangyanbin
# contact:	yanbin_zhang@foxitsoftware.com
#
. functions.sh

echo "--> Begin to download war file"
if [ ! -e /tmp/war ]; then
	mkdir -p /tmp/war
fi

if [ ${DL_SERVER} == "it-deploy.foxitcloud.com" ]; then
	rsync -av --rsh="ssh -p 22 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}" smx@10.103.3.151:/opt/www/ops30.sumilux.com/war/foxit-apimgt-web.war /tmp/war
else
	rsync -av --rsh="ssh -p 333 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}" smx@${DL_SERVER}:/opt/www/ops30.sumilux.com/war/foxit-apimgt-web.war /tmp/war
fi

echo "--> Begin to download selenium file"
if [ ${DL_SERVER} == "it-deploy.foxitcloud.com" ]; then
	rsync -av --rsh="ssh -p 22 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}" smx@10.103.3.151:/opt/www/ops30.sumilux.com/selenium /tmp/
else
	rsync -av --rsh="ssh -p 333 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}" smx@${DL_SERVER}:/opt/www/ops30.sumilux.com/selenium /tmp/
fi
